/*
 * @Author: your name
 * @Date: 2022-01-17 12:03:47
 * @LastEditTime: 2022-01-20 18:50:30
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \json-serveg:\桌面2\VueStudy\vue-test4\vue-eqidemic\src\router\index.js
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'


//异步加装组件
const Hesuan =() => import('../components/HeSuan/HeSuan.vue')
const Area =() => import('../components/Area/Area.vue')
const Prevention =() => import('../components/Prevention/Prevention.vue')
const Citys =() => import('../components/Citys/Citys.vue')
const Travel =() => import('../components/Travel/Travel.vue')
const SearchCity =() => import('../components/SearchCity/SearchCity.vue')

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/hesuan',
    name: 'HeSuan',
    component: Hesuan
  },
  {
    path: '/area',
    name: 'Area',
    component: Area
  },
  {
    path: '/prevention',
    name: 'Prevention',
    component: Prevention
  },
  {
    path: '/citys/:cityname',
    name: 'Citys',
    component: Citys,
    props:true
  },
  {
    path: '/travel',
    name: 'Travel',
    component: Travel
  },
  {
    path: '/searchcity',
    name: 'SearchCity',
    component: SearchCity
  },
]

const router = new VueRouter({
  routes
})

export default router
